import request from "@/utils/request";

// 查询资产表列表
export function listAsset(query) {
  return request({
    url: "/admin/assets/assets/",
    method: "get",
    params: query
  });
}

// 查询资产表详细
export function getAsset(id) {
  return request({
    url: "/admin/assets/assets/" + id + "/",
    method: "get"
  });
}

// 新增资产表
export function addAsset(data) {
  return request({
    url: "/admin/assets/assets/",
    method: "post",
    data: data
  });
}

// 修改资产表
export function updateAsset(data) {
  return request({
    url: "/admin/assets/assets/" + data.id + "/",
    method: "put",
    data: data
  });
}

// 删除资产表
export function delAsset(id) {
  return request({
    url: "/admin/assets/assets/" + id + "/",
    method: "delete"
  });
}

// 导出资产表
export function exportAsset(query) {
  return request({
    url: "/admin/assets/assets/export/",
    method: "get",
    params: query
  });
}

// 资产导入
export function importsAsset(data) {
  return request({
    url: "/admin/assets/assets/import/",
    method: "post",
    data: data
  });
}

// 资产维护查询
export function listMaintenances(query) {
  return request({
    url: "/admin/assets/maintenances/",
    method: "get",
    params: query
  });
}

// 资产维护查询详细
export function getMaintenances(id) {
  return request({
    url: "/admin/assets/maintenances/" + id + "/",
    method: "get"
  });
}

// 新增资产维护
export function addMaintenances(data) {
  return request({
    url: "/admin/assets/maintenances/",
    method: "post",
    data: data
  });
}

// 修改资产维护
export function updateMaintenances(data) {
  return request({
    url: "/admin/assets/maintenances/" + data.id + "/",
    method: "put",
    data: data
  });
}

// 删除资产维护
export function delMaintenances(id) {
  return request({
    url: "/admin/assets/maintenances/" + id + "/",
    method: "delete"
  });
}

// 借还历史表
export function Assetrecords(query) {
  return request({
    url: "/admin/assets/assetrecords/",
    method: "get",
    params: query
  });
}

// 借出
export function assetCheckout(data) {
  return request({
    url: "/admin/assets/assetcheckout/",
    method: "post",
    data: data
  });
}

// 归还
export function assetCheckin(data) {
  return request({
    url: "/admin/assets/assetcheckin/",
    method: "post",
    data: data
  });
}

// 新增pro借还资产
export function checkhis(query) {
  return request({
    url: "/admin/assets/checkhis/",
    method: "get",
    params: query
  });
}

// 审核
export function audit(data) {
  return request({
    url: "/admin/assets/audit/",
    method: "post",
    data: data
  });
}
